package com.lzh.exer1;

import java.util.List;

/**
 * @author liuzhihao
 * @create 2021-02-22 17:00
 */
public class DAOTest {

    public static void main(String[] args) {

        DAO<User> dao = new DAO<>();

        dao.save("1001",new User(1001,34,"周杰伦"));
        dao.save("1002",new User(1002,20,"刘智豪"));
        dao.save("1003",new User(1002,60,"李白"));

        dao.update("1003",new User(1003,30,"哈哈哈"));

        dao.delete("1002");

        List<User> list = dao.list();
//        System.out.println(list);
        list.forEach(System.out::println);



    }

}
